<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>IconFont</title>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <link rel="stylesheet" href="/static/lib/layui/css/layui.css">

</head>
<body>
<div>
    <div id="test1"></div>
    <script type="application/javascript" src="/static/lib/layui/layui.js"></script>
</div>
<script>
    layui.use('tree', function () {
        var tree = layui.tree;
        //渲染
        var inst1 = tree.render({
            elem: '#test1'  //绑定元素
            , data: [{
                title: '江西' //一级菜单
                , children: [{
                    title: '南昌' //二级菜单
                    , children: [{
                        title: '高新区' //三级菜单
                        //…… //以此类推，可无限层级
                    }]
                }]
            }, {
                title: '陕西' //一级菜单
                , children: [{
                    title: '西安' //二级菜单
                }]
            }]
        });
    });
</script>
</body>
</html>
